package day3.Animal;

public class Test {
    public static void main(String[] args) {
        Animal animal = new Animal("张三") {
            @Override
            public void eat() {
                System.out.println(super.getName()+"吃饭");
            }

            @Override
            public void sleep() {
                System.out.println(super.getName()+"睡觉");
            }
        };
        animal.eat();
        animal.sleep();
    }
}
